﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="edit.aspx.cs" Inherits="orgman_users_edit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>修改用户</title><link href="../../css/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    <div id="content">
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:appConnectionString %>" 
            DeleteCommand="DELETE FROM [users] WHERE [userid] = @userid" 
            InsertCommand="INSERT INTO [users] ([username], [realname], [sex], [email], [mphone], [phone], [address], [postcode], [organizationid], [description]) VALUES (@username, @realname, @sex, @email, @mphone, @phone, @address, @postcode, @organizationid, @description)" 
            SelectCommand="SELECT * FROM [users] WHERE ([username] = @username)" 
            UpdateCommand="UPDATE [users] SET  [realname] = @realname, [sex] = @sex, [email] = @email, [mphone] = @mphone, [phone] = @phone, [address] = @address, [postcode] = @postcode, [description] = @description WHERE [userid] = @userid">
            <SelectParameters>
                <asp:QueryStringParameter Name="username" QueryStringField="un" Type="String" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="userid" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="username" Type="String" />
                <asp:Parameter Name="realname" Type="String" />
                <asp:Parameter Name="sex" Type="String" />
                <asp:Parameter Name="email" Type="String" />
                <asp:Parameter Name="mphone" Type="String" />
                <asp:Parameter Name="phone" Type="String" />
                <asp:Parameter Name="address" Type="String" />
                <asp:Parameter Name="postcode" Type="String" />
                <asp:Parameter Name="organizationid" Type="Int32" />
                <asp:Parameter Name="description" Type="String" />
                <asp:Parameter Name="userid" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="username" Type="String" />
                <asp:Parameter Name="realname" Type="String" />
                <asp:Parameter Name="sex" Type="String" />
                <asp:Parameter Name="email" Type="String" />
                <asp:Parameter Name="mphone" Type="String" />
                <asp:Parameter Name="phone" Type="String" />
                <asp:Parameter Name="address" Type="String" />
                <asp:Parameter Name="postcode" Type="String" />
                <asp:Parameter Name="organizationid" Type="Int32" />
                <asp:Parameter Name="description" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
            DataKeyNames="userid" DataSourceID="SqlDataSource1" 
            Height="50px" Width="50%">
            <Fields>
                <asp:BoundField DataField="userid" InsertVisible="False" 
                    ReadOnly="True" SortExpression="userid" Visible="False" >
                    <HeaderStyle HorizontalAlign="Right" Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="username" HeaderText="用户名：" 
                    SortExpression="username" >
                    <HeaderStyle HorizontalAlign="Right" Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="realname" HeaderText="真实姓名：" 
                    SortExpression="realname" >
                    <HeaderStyle HorizontalAlign="Right" Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="sex" HeaderText="性别：" SortExpression="sex" >
                    <HeaderStyle HorizontalAlign="Right" Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="email" HeaderText="E-mail：" SortExpression="email" >
                    <HeaderStyle HorizontalAlign="Right" Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="mphone" HeaderText="手机号码：" 
                    SortExpression="mphone" >
                    <HeaderStyle HorizontalAlign="Right" Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="phone" HeaderText="单位电话：" SortExpression="phone" >
                    <HeaderStyle HorizontalAlign="Right" Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="address" HeaderText="居住地址：" 
                    SortExpression="address" >
                    <HeaderStyle HorizontalAlign="Right" Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="postcode" HeaderText="邮编号码：" 
                    SortExpression="postcode" >
                    <HeaderStyle HorizontalAlign="Right" Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="description" HeaderText="备注信息：" 
                    SortExpression="description" >
                    <HeaderStyle HorizontalAlign="Right" Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="organizationid" HeaderText="organizationid" 
                    SortExpression="organizationid" Visible="False" />
                <asp:CommandField ShowEditButton="True" />
            </Fields>
            <EditRowStyle Font-Size="14px" />
        </asp:DetailsView>
    </div>
    
    </div>
    </form>
</body>
</html>
